<script setup lang="ts">
import { getVersionList, uploadVersion } from '@/api/system/version';
import type { Version } from '@/api/system/version/type';
import Upload from './components/Upload.vue';
import { onMounted, ref } from 'vue';

const versionList = ref([] as Version[]);
const dialogVisible = ref(false);

onMounted(() => {
    getVersionList().then((res) => {
        versionList.value = res.data as Version[];
    });
})

</script>

<template>
    <div class="content">
        <div class="row">
            <el-button type="primary" @click="dialogVisible = true">上传版本</el-button>
        </div>
        <el-table :data="versionList" style="width: 100%" stripe border>
            <el-table-column prop="name" label="版本名" />
            <el-table-column prop="content" label="版本内容" />
        </el-table>
        <Upload v-model="dialogVisible"></Upload>
    </div>
</template>

<style lang="scss" scoped>
.row {
    margin-bottom: 1%;
    display: flex;
}
</style>